import 'package:flutter/material.dart';

class CheckboxPage extends StatefulWidget {
  @override
  _CheckboxPageState createState() => new _CheckboxPageState();
}

class _CheckboxPageState extends State<CheckboxPage> {
  @override
  Widget build(BuildContext context) {
    final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey();

    return Scaffold(
      key: _scaffoldKey,
      appBar: AppBar(
        title: Text("Checkbox"),
      ),
      body: _buildListView(),
    );
  }

  Widget _buildListView() {
    return ListView.builder(
      itemBuilder: (context, index) {
        return _buildListViewItem(index);
      },
      itemCount: checkboxs.length,
    );
  }

  Widget _buildListViewItem(index) {
    return Container(
      padding: EdgeInsets.all(10.0),
      alignment: Alignment.center,
      child: checkboxs[index],
    );
  }
}

var _checkValue = false;

List<Widget> checkboxs = <Widget>[
  Column(
    children: <Widget>[
      Text("Checkbox"),
      Container(
        child: Checkbox(
          value: _checkValue,
          onChanged: (value) {},
        ),
      ),
    ],
  ),
  Column(
    children: <Widget>[
      Text("CheckboxListTile"),
      Container(
        child: CheckboxListTile(
          title: Text('Gnerv'),
          value: _checkValue,
        ),
      ),
    ],
  ),
  Column(
    children: <Widget>[
      Text("CheckboxListTile"),
      Container(
        child: CheckboxListTile(
          title: Text('Gnerv'),
          subtitle: Text('Gnerv'),
          secondary: Icon(Icons.person),
          value: _checkValue,
        ),
      ),
    ],
  ),
];
